#include<cstdlib>
#include<iostream>
#include<memory>
#include <string>
using namespace std;
#include <crtdbg.h>

class  Experience
{
public:
	Experience():mTimeArea(""),  mCompany(""){}
	Experience(string iTimeAreaStr, string iCompanyStr):mTimeArea(iTimeAreaStr),mCompany(iCompanyStr){	}

	void setExperince(string iTimeAreaString, string iCompanyStr)
	{
		mTimeArea = iTimeAreaString;
		mCompany = iTimeAreaString;
	}
	void GetExperience(string& orTimeArea, string& orCompany)
	{
		orTimeArea = mTimeArea;
		orCompany = mCompany;
	}
private:
	string mTimeArea;
	string mCompany;
};
class Resume
{
public:
	Resume(string iNameStr, string iSexStr, int iAge)
		:mName(iNameStr),mSex(iSexStr), mAge(iAge),mExperience(){}
	~Resume(){}

	
	void Display()
	{
		cout<<"Name: \t" <<mName<<"\t Sex:  "<<mSex <<"\t Age:" << mAge <<endl;
		cout<<"Work Experience :"<<endl;
		string lTimeArea; 
		string lCompany;
		mExperience.GetExperience(lTimeArea,lCompany);
		cout<<"Time Area: \t" <<lTimeArea<<"\t Company:  "<<lCompany<<endl;
	}

	virtual Resume  Clone()
	{
		Resume lResume(mName,mSex,mAge);
		string lTimeArea; 
		string lCompany;
		return lResume;
	}
	void AddExperince(string iTimeAreaString, string iCompanyStr)
	{
		mExperience.setExperince(iTimeAreaString,iCompanyStr);
	}
private:
	string mName;
	string mSex;
	int mAge;
	Experience mExperience; 

};
int main()
{
	Resume r1("XiaoCai", "man",25);
	r1.AddExperince("2014-2016", "BABA");
	r1.Display();
	Resume r2 = r1.Clone();
	r2.AddExperince("2013-2015", "Baidu");
	r2.Display();

	getchar();
}